package com.fenquen.dfs.router.init;

import com.fenquen.dfs.router.multicast.MulticastReceiver;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class NettyInitializer implements InitializingBean {
    @Autowired
    private MulticastReceiver multicastReceiver;

    @Override
    public void afterPropertiesSet() throws Exception {
        boolean success = multicastReceiver.boot();
        if (!success) {
            System.exit(0);
        }
    }
}
